<template>
  <div class="subtitle">
    <div class="zh-title">{{zhTitle}}</div>
    <div class="inline" :class="lineClass" :style="{'margin-top': lineSpace +'px','margin-bottom': lineSpace +'px'}"></div>
    <div class="en-titile" v-if="enTitle != ''">{{enTitle}}</div>
  </div>
</template>

<script>

  export default {
    name: 'subtitle',
    props: {
      zhTitle: {
        type: String
      },
      enTitle: {
        type: String,
        default: ''
      },
      linePosition: {
        type: String,
        default: 'center'
      },
      lineSpace: {
        type: Number,
        default: 15
      }
    },
    data() {
      return {
      }
    },
    computed: {
      lineClass() {
        // 默认居中
        return this.linePosition == 'left' ? 'line-left' : ''
      },
    }
  }
</script>

<style lang="less">
  .subtitle {
    display: inline-block;
    text-align: center;
    .zh-title {
      font-size: 24px;
      color: #47beda;
    }
    .inline {
      width: 40px;
      height: 4px;
      margin: 15px auto;
      &.line-left {
        margin: 15px 0;
      }
      background-color: #47beda;
      border-radius: 2px;
    }
    .en-title {
      font-family: ArialMT;
      font-style: italic;
      font-size: 18px;
      color: #333;
    }
  }
</style>